<extend name="Base/base" />
<block name='head'>
    <link rel="stylesheet" href="/Public/Index/css/plan/details.css" media="screen" type="text/css" />
    <link rel="stylesheet" href="/Public/Index/css/plan/style.css" media="screen" type="text/css" />
    <link rel="stylesheet" href="/Public/Admin/css/personal.css"/>
    <!--文件上传-->
    <script type="text/javascript" src="/Public/Cropper/js/ajaxfileupload.js" ></script>
    <style>
        .button{margin-top:2%}
        .detail-content{margin: 0 5%}
        .plan_details{margin-bottom: 12px;}
        .listWrap .list_det,.det2{margin:0;}
        .add_detl_nr_wrap{padding:30px 16px 0 16px;}
        .add_detl_nr{border-bottom:1px solid #ededed;margin-bottom:25px;}
        .add_detl_nr h4{margin-top:0;display: inline-block;font-size:14px;}
        .add_detl_nr textarea{width: 78%;display: inline;margin-bottom:20px;}
        .icon_add{color:#1eb500;margin-left:12px;}
        #upload{background:url(/Public/Admin/images/file.png) no-repeat left top;padding-left:20px;display: block;padding-bottom:20px;}
        .button{margin-bottom: 20px;}
    </style>
</block>
<block name="content"> 
    <section class="layui-larry-box">
        <div class="larry-personal workPlanDetail-page">
            <div class="layui-tab">
                <p class="nav-title">
                    <a class="newsAdd_btn" title="返回" href="javascript:history.go(-1)"><img src="/Public/Admin/images/back.png" /></a>
                    <a href="{:U('Plan/index')}"><span>计划列表</span></a> &nbsp;> &nbsp;<a href="{:U('Plan/show',array('id'=>$plan_id))}"><span>计划详情</span></a> &nbsp;> &nbsp;计划进度
                </p>
                <form>
                    <div class="detail-content">
                        <h2>{$plan.name}</h2>
                        <div class="row">
                            <div class="col-lg-5 col-sm-5">
                                <div class="add_detl plan_details">
                                    <h3><span>添加进度日志</span></h3> 
                                    <div class="add_detl_nr_wrap">       
                                        <div class="add_detl_nr">
                                            <h4>完成百分比&nbsp;&nbsp;<span>(上次进度值{$plan.total|default=0}%)</span></h4>
                                            <input type='hidden' name='percent' id='percent' value='222wd'>
                                            <input type="hidden" name="old_total" value="{$plan.total|default=0}">
                                            <div class="range-holder">
                                                <div id="pr-slider1" class="dragdealer1">
                                                    <div class="stripe1">
                                                        <div class="handle1">
                                                            <div class="infobox1">
                                                                <div class="innerbox1">
                                                                    <div class="info-price1"></div>
                                                                </div>
                                                            </div>		
                                                        </div>
                                                    </div>
                                                </div>
                                                <div id="pr-slider2" class="dragdealer2">
                                                    <div class="stripe2">
                                                        <div class="handle2">
                                                            <div class="infobox2">
                                                                <div class="innerbox2">
                                                                    <div class="info-price2"></div>
                                                                </div>
                                                            </div>		
                                                        </div>
                                                    </div>
                                                </div>
                                                <div id="pr-slider" class="dragdealer">
                                                    <div class="stripe">
                                                        <div class="handle">
                                                            <div class="infobox">
                                                                <div class="innerbox">
                                                                    <div class="info-price"></div>
                                                                </div>
                                                            </div>		
                                                            <div class="square" style="height:25px">
                                                                <span class="value"></span>
                                                                <span class="menu-line"></span>
                                                                <span class="menu-line"></span>
                                                                <span class="menu-line"></span>
                                                            </div>	
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="add_detl_nr editorArea">
                                            <h4 style="width:20%">进度详情</h4>
                                            <textarea name="progress" id="content"></textarea>
                                        </div>
                                        <div class="add_detl_nr">
                                            <h4>是否写入工作日志</h4>
                                            <lable>
                                                <i class='input_style radio_bg'><input type="radio" name="is_diary" value="1" ></i>
                                                是
                                            </lable>
                                            <lable>
                                                <i class='input_style radio_bg radio_bg_check'><input type="radio" name="is_diary" value="0" checked></i>
                                                否
                                            </lable>
                                        </div>
                                        <div class="add_detl_nr">
                                            <!--                                            <h4>附件</h4>-->
                                            <a href="#" id="upload"><span class="fj">上传附件</span><span class="icon_add">&#xe638;</span></a>
                                            <div class="filename-cont">
                                            </div>
                                            <input type="file" id="inputImage" name='imgfile' style="display:none">
                                            <input type="hidden" id="filename" name="uploads" value="">
                                            <input type="hidden" id="fileurl" name="uploads_url" value="">
                                            <input type="hidden" name="url" value="{:U('delFile')}">
                                        </div>
                                        <div class="button">
                                            <input type='hidden' name='id' value='{$info.plan_id}'>
                                            <a class="layui-btn btn-submit ajax-post" data-url="{:U('schedule')}" data-form="">提交</a>
                                        </div>  
                                    </div>     
                                </div>    
                            </div>
                            <div class="col-lg-7 col-sm-7">
                                <div class="plan_details">
                                    <h3><span>进度日志详情</span></h3>
                                    <div class="listWrap">
                                        <if condition="$plan[info] neq null">
                                            <foreach name='plan.info' item='detail'>
                                                <div class="plan_details">
                                                    <div class="list_det">
                                                        <dl>
                                                            <dt class="det1 title_1"><img src="/Public/Index/img/icon_0.svg" />{$detail.write_time}</dt>
                                                            <dd class="det1"><span>完成{$detail.percent}%</span></dd>
                                                        </dl>
                                                        <dl>
                                                            <dt class="det2">             
                                                                <span class="det_nr">{$detail.progress|htmlspecialchars_decode}</span>
                                                            </dt>
                                                        </dl>
                                                    </div>
                                                </div>
                                            </foreach>
                                            <else />
                                            <div class="plan_details">无进度日志</div>
                                        </if>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <!--<input type="hidden" name="is_diary" value="0">-->
                        <input type="hidden" name="plan_id" value="{$plan_id}">
                        <input type="hidden" name="is_end" value="{$is_end}">
                        <input type="hidden" name="dept" value="{$dept}">
                        <input type="hidden" name="cType" value="{$cType}">
                        <input type="hidden" name="lng" value="" />
                        <input type="hidden" name="lat" value="" />
                        <!--传递条件参数-->
                        <input type='hidden' name="type" value="{$type}" /> 
                        <input type="hidden" id="prevProress" value="{$plan.total|default=0}" />
                    </div>
                </form>
            </div>
        </div>
    </section>  
</block>
<block name="script">
    <script type="text/javascript" src="/Public/Index/js/plan/index.js"></script>
    <script type="text/javascript" src="/Public/Admin/js/plan.js"></script>
    <script type="text/javascript" src="/Public/Admin/js/common.js"></script>
    <!--编辑器-->
    <link rel="stylesheet" href="__PUBLIC__/static/ueditor/themes/default/css/ueditor.css"/>
    <script type="text/javascript" src="__PUBLIC__/static/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" src="__PUBLIC__/static/ueditor/ueditor.all.min.js"></script>
    <script type="text/javascript">
        $(initSchedule())
        $(initUpload("{:U(CONTROLLER_NAME.'/upload')}","plan"));
        $(function () {
            $('.planSubmit').click(function () {
                if ($('textarea[name=progress]').val() == '' || ($('input[name=percent]').val() == '')) {
                    layer.msg('进度详情和百分比不能为空')
                    $(this).removeClass('btn-submit');
                } else {
                    $(this).addClass('btn-submit');
                }
            })

        });
        
        var width = $('.editorArea').width();
        var ue = UE.getEditor('content', {
            initialFrameWidth: width,
            initialFrameHeight: 200,
            toolbars: [[
                    "source", "undo", "redo", "insertunorderedlist", "insertorderedlist", "unlink", "link",
                    "searchreplace", "preview", "pagebreak", "simpleupload", "emotion",
                    "date", "time", "horizontal", "pasteplain",
                    "bold", "italic", "underline", "strikethrough", "forecolor", "backcolor",
                    "superscript", "subscript", "justifyleft", "justifycenter", "justifyright", "justifyjustify",
                    "formatmatch", "removeformat", "lineheight", "fontfamily", "fontsize",
                ]],
        });
        
        $('input[name="is_diary"]').on('click',function(){
            var checked = $(this).attr('checked');
            if(checked == 'checked'){
                
            }else{
               $(this).parent().addClass('radio_bg_check');
               $(this).attr('checked',true);
               $(this).parents('lable').siblings().find("i").removeClass('radio_bg_check');
                $(this).parents('lable').siblings().find("input").attr('checked',false);
            }
        })
    </script>
    
</block>